A network packet processing system can be viewed as a stream processing system in which packets of a data stream are the data items. A stream processing system can process multiple streams of input data packet-by-packet to produce multiple streams of output data based upon the packets. Input packets within a data stream can have a particular order amongst them and often require that input packets be processed in that particular order (in-order processing) and that each input packet be subject to the same process flow. For example, the processing of input packets within a data stream using a stream processing algorithm is often arranged as a pipeline of independent processing steps (stages), where each input packet of a particular data stream goes through all of the processing pipeline stages. If a data stream is an ordered data stream, the input packets should be processed in-order. For some data streams the processing of the input packets is stateful in that there is global stream context data that needs to be maintained. For example, monitoring and statistics information may be gathered and maintained per data stream by accessing and updating state information in a memory where the data stream's global stream context data is maintained during processing the data stream. This per stream context data is global in that it may be shared by one or more of the data stream's independent processing pipeline stages. As a further example, the processing can be stateful in that a data stream processing system may provide a mechanism, for example, locks or semaphores, to guarantee atomicity of access to the shared per stream global stream context data by each independent processing stage. However, locks and semaphores may have high processing overhead and may result in higher latency than desired.
The use of the same reference symbols in different drawings indicates similar or identical items.